package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86185
 * Date: 2023-03-21
 * Time: 19:04
 */
class Animal {
    public String name;
    public int age;

    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void eat() {
        System.out.println("eating");
    }
    public void run() {
        System.out.println("running");
    }
}
class Dog extends Animal {
    public Dog(String name, int age) {
        super(name, age);
    }

    @Override
    public void run() {
        System.out.println(name + " is running");
    }

    @Override
    public void eat() {
        System.out.println(name + " is eating bone");
    }
    public void bark() {

    }
}
public class Test {
    public static void main(String[] args) {
        Animal dog1 = new Dog("DAWANG", 12);
        dog1.run();
    }
}
